//
//  AssetHelper.m
//  DoImagePickerController
//
//  Created by James on 2014. 1. 23..
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <AssetsLibrary/AssetsLibrary.h>
#import <Contacts/Contacts.h>
#import <Photos/Photos.h>

#define ASSETHELPER    [AssetHelper sharedAssetHelper]

#define ASSET_PHOTO_THUMBNAIL           0
#define ASSET_PHOTO_ASPECT_THUMBNAIL    1
#define ASSET_PHOTO_SCREEN_SIZE         2
#define ASSET_PHOTO_FULL_RESOLUTION     3

typedef void(^ResultBlock)(NSString *fliePath);

@protocol AssetHelperDelegate <NSObject>

- (void)dataDidChange;

@end


@interface AssetHelper : NSObject

@property (nonatomic, strong, readonly) NSMutableArray *allPhotos;
@property (nonatomic, strong, readonly) NSMutableArray *allVideos;
@property (nonatomic, strong, readonly) NSMutableArray *allContacts;
@property (nonatomic, copy, readonly) NSString *contactFilePath;

@property (nonatomic, weak) id<AssetHelperDelegate> delegate;


+ (AssetHelper *)sharedAssetHelper;

- (void)fetchAllPhotosAndVideos;

- (void)fetchAllContacts;

- (void)removeAllTmpData;

- (void)requestImageDataForAsset:(PHAsset *)asset andResultBlock:(ResultBlock)block;
- (void)requestVideoDataForAsset:(PHAsset *)asset andResultBlock:(ResultBlock)block;

- (void)saveFileWithPath:(NSString *)filePath;

@end

